// app.js
//本页面以及本小程序用到的所有图标以及图片均为开源!!!

App({
  onLaunch() {
   var userInfo = wx.getStorageSync('userInfo')
   if(userInfo){
     this.globalData.userInfo = userInfo
   }
  },
  globalData: {
    userInfo: null
  },
  initUserInfo(res){
    var info = {
      token:res.token,
      phone:res.phone,
      nickName:res.nickname,
      avatarUrl:res.avatar,
      submit_count:res.submit_count,
      fans_count:res.fans_count,
      character:res.character,
      introduction:res.introduction
    }
    this.globalData.userInfo = info
    wx.setStorageSync('userInfo', info)
  },
  delUserInfo(){
    this.globalData.userInfo = null
    wx.removeStorageSync('userInfo')
  }
  
})
